package com.upf1sh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.upf1sh.bean.AudioOrVideoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface AudioOrVideoMapper extends BaseMapper<AudioOrVideoEntity> {
    @Select("select * from audio_or_video ORDER BY time DESC")
    public List<AudioOrVideoEntity> selectAllByTime();

    @Select("select * from audio_or_video where type=#{type} ORDER BY time DESC")
    public List<AudioOrVideoEntity> selectAllByType(String type);

    @Select("select * from audio_or_video where path=#{path} AND type='audio' ")
    public AudioOrVideoEntity selectAudioByPath(String path);


}
